home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Technical Documentation / PCI Information / PCI Developer’s Kit (disk) / Native Drivers / NuDrivers.h < prev    next >
Encoding:
Text File  |  1994-06-27  |  2.6 KB  |  85 lines  |  [TEXT/MPCC]

  1. //
  2. // NuDrivers.h
  3. //
  4.  
  5. #ifndef _NuDrivers_
  6. #define _NuDrivers_    1
  7.  
  8. typedef long        DriverDescVersion;
  9. typedef long        DriverVersion;
  10. typedef OSType        DriverDescSignature;
  11.  
  12. enum
  13. {
  14.     theDescriptionSignature = 'mtej'                // must appear in first long
  15. };                                                    // of DriverDescription
  16.  
  17. typedef struct DriverDescription {
  18.     DriverDescSignature    driverDescSignature;        // Signature field of this structure
  19.     DriverDescVersion    driverDescVersion;            // Version of this data structure
  20.     OSType                driverDeviceFamilyType;        // Family of devices
  21.     OSType                driverType;                    // Type of driver within the family
  22.     OSType                driverSubType;                // SubType of driver within family
  23.     OSType                driverManufacturer;            // Maker of this driver
  24.     DriverVersion        driverVersion;                // Maker's driver version
  25.     Boolean                driverIsAgent;                // Future use only
  26.     Boolean                driverIsConcurrent;            // Driver handles concurrent requests
  27.     char                driverNameLength;            // Length of driver's name
  28.     char                driverName[32];                // Driver's name
  29.     long                driverReservedLength;        // length of reserved area
  30.     char                driverDescReserved[4];        // Reserved area for the future
  31. } DriverDescription, *DriverDescriptionPtr;
  32.  
  33. typedef unsigned long IOCommandCode;
  34. enum
  35. {
  36.     OpenCmd,                                // The Driver Open            Command
  37.     CloseCmd,                                // The Driver Close            Command
  38.     ReadCmd,                                // The Driver Read            Command
  39.     WriteCmd,                                // The Driver Write            Command
  40.     ControlCmd,                                // The Driver Control        Command
  41.     StatusCmd,                                // The Driver Status        Command
  42.     KillIOCmd,                                // The Driver KillIO        Command
  43.     InitializeCmd,                            // The Driver Initialize    Command
  44.     FinalizeCmd                                // The Driver Finalize        Command
  45. };
  46.  
  47. typedef unsigned long IOCommandID;
  48.  
  49. typedef unsigned long IOCommandKind;
  50. enum
  51. {
  52.     SynchronousIOCommandKind    = 0x00000001,
  53.     AsynchronousIOCommandKind    = 0x00000002,
  54.     ImmediateIOCommandKind        = 0x00000004
  55. };
  56.  
  57. typedef unsigned long DeviceNodeID;
  58.  
  59. typedef struct InitializationInfo {
  60.         DCtlPtr            theDce;
  61.         DeviceNodeID    theDeviceNode;
  62. } InitializationInfo, *InitializationInfoPtr;
  63.  
  64. typedef struct FinalizationInfo {
  65.         DCtlPtr            theDce;
  66.         DeviceNodeID    theDeviceNode;
  67. } FinalizationInfo, *FinalizationInfoPtr;
  68.  
  69. // Contents are command specific
  70.  
  71. typedef union {
  72.         ParmBlkPtr                thePb;            // Value for OPEN, CLOSE, READ, WRITE, etc,...
  73.         InitializationInfoPtr    theInitialInfo;    // Value for INITIALIZE
  74.         FinalizationInfoPtr        theFinalInfo;    // Value for FINALIZE
  75. } IOCommandContents;
  76.  
  77. typedef OSErr (NuDriverEntryPoint)    (    IOCommandID                    theID,
  78.                                         IOCommandContents            theContents,
  79.                                         IOCommandCode                theCode,
  80.                                         IOCommandKind                theKind );
  81.  
  82. typedef NuDriverEntryPoint    *NuDriverEntryPointPtr;
  83.  
  84. #endif
  85.